package mil.af.amc.adpetracker.dao;

import java.util.List;

/**
 * Interface for GenericDAO implementations
 *
 * @author TSgt Jason Ferguson
 */

public interface GenericDao<T> {

    /**
     * Get a particular object by its unique ID
     *
     * @param id    an int representing the unique ID of the object
     * @return      an object with the given unique ID
     */
    T getById(int id);

    /**
     * Get a list of all the objects of the given type
     *
     * @return
     */
    List<T> getAll();

    /**
     * Return a count of all objects
     *
     * @return
     */
    int getCount();

    /**
     * Save or update an object
     * @param object
     * @return
     */
    void saveOrUpdate(T object);

    /**
     * Delete a persistent object
     *
     * @param persistentObject
     */
    void delete(T persistentObject);

    T save(T object);

    //Integer add(T object);

    T merge(T object);

    List<T> getByQbe(T object);
}
